package com.nuoniu.sibanyun.controller.project;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nuoniu.sibanyun.common.BaseController;
import com.nuoniu.sibanyun.common.result.HttpResult;
import com.nuoniu.sibanyun.entity.project.SysSdtProjectCatalogue;
import com.nuoniu.sibanyun.service.project.ISysSdtProjectCatalogueService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 项目目录管理 前端控制器
 * </p>
 *
 * @author 小啊刚
 * @since 2021-06-05
 */
@RestController
@RequestMapping("/sdt/projectCatalogue")
@Api(tags = "项目目录管理")
public class SysSdtProjectCatalogueController extends BaseController {

    @Autowired
    private ISysSdtProjectCatalogueService projectCatalogueService;

    @ApiOperation("保存")
    @PostMapping("save")
    public HttpResult save(@RequestBody SysSdtProjectCatalogue projectCatalogue) {
        projectCatalogueService.saveProjectCatalogue(projectCatalogue);
        return HttpResult.ok();
    }

    @ApiOperation("获取列表")
    @GetMapping("pageList")
    public HttpResult pageList(Page page, SysSdtProjectCatalogue projectCatalogue) {
        return HttpResult.ok(projectCatalogueService.pageList(page, projectCatalogue));
    }

    @ApiOperation("删除")
    @DeleteMapping("delete")
    public HttpResult delete(Long id) {
        projectCatalogueService.deleteById(id);
        return HttpResult.ok();
    }
}
